<template>
    <el-table :data="list" style="width: 100%;padding-top: 15px;">
        <el-table-column label="标题" min-width="100">
            <template slot-scope="scope">
                {{ scope.row.title }}
            </template>
        </el-table-column>
        <el-table-column label="是否开启" min-width="100" align="center">
            <template slot-scope="scope">
                {{ scope.row.done}}
            </template>
        </el-table-column>
        <el-table-column label="key" min-width="100" align="center">
            <template slot-scope="scope">
                <el-tag :type="scope.row.key"> {{ scope.row.key }}</el-tag>
            </template>
        </el-table-column>
    </el-table>
</template>

<script>
    import { fetchList } from '@/api/transaction';

    export default {
        filters: {
            statusFilter(status) {
                const statusMap = {
                    success: 'success',
                    pending: 'danger'
                };
                return statusMap[status];
            },
            orderNoFilter(str) {
                return str.substring(0, 30);
            }
        },
        props: ['msg'],
        data() {
            return {
                list: null
            };
        },
        created() {
            this.fetchData();
        },
        methods: {
            fetchData() {
                this.list = this.msg;
            }
        }
    };
</script>
